//
//  Kanbox_TrendsTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 2016/10/14.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Kanbox_TrendsTableViewCell.h"

@implementation Kanbox_TrendsTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image_head = [[UIImageView alloc] init];
    self.image_head.layer.cornerRadius = 5;
    self.image_head.layer.masksToBounds = YES;
    self.image_head.image = [UIImage imageNamed:@"heads.jpg"];
    [self.contentView addSubview:self.image_head];
    
    self.name = [[UILabel alloc] init];
    self.name.text = @"员工姓名";
    self.name.textColor = [UIColor blackColor];
    [self.contentView addSubview:self.name];
    
    self.time = [[UILabel alloc] init];
    self.time.text = @"14:23";
    self.time.textAlignment = NSTextAlignmentRight;
    self.time.textColor = [UIColor grayColor];
    self.time.font = [UIFont systemFontOfSize:15.0f];
    [self.contentView addSubview:self.time];
    
    self.view_bg = [[UIView alloc] init];
    self.view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_bg];
    
    self.image_Prompt = [[UIImageView alloc] init];
    self.image_Prompt.layer.masksToBounds = YES;
    self.image_Prompt.image = [UIImage imageNamed:@"pdf.png"];
    [self.view_bg addSubview:self.image_Prompt];
    
    
    self.title_size = [[UILabel alloc] init];
    self.title_size.text = @"8888M";
    self.title_size.textColor = [UIColor grayColor];
    self.title_size.font = [UIFont systemFontOfSize:14.0f];
    self.title_size.textAlignment = NSTextAlignmentRight;
    [self.view_bg addSubview:self.title_size];
    
    self.title_name = [[UILabel alloc] init];
    self.title_name.text = @"智顺内部纷享使用规范";
    self.title_name.numberOfLines = 0;
    self.title_name.font = [UIFont systemFontOfSize:14.0f];
    self.title_name.textColor = [UIColor blackColor];
    [self.view_bg addSubview:self.title_name];
    
    self.btn_bg = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.view_bg addSubview:self.btn_bg];
    
    self.view_Line = [[UIView alloc] init];
    self.view_Line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_Line];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image_head.frame = CGRectMake(15, 15, 40, 40);
    
    self.name.frame = CGRectMake(CGRectGetMaxX(self.image_head.frame) + 10, 18, 100, 15);
    
    self.time.frame = CGRectMake(SCREEN_WIDTH - 90, 16, 65, 15);
    
    self.view_bg.frame = CGRectMake(CGRectGetMaxX(self.image_head.frame) + 10, CGRectGetMaxY(self.name.frame) + 8, SCREEN_WIDTH - CGRectGetMaxX(self.image_head.frame) - 10 - 15, 40);
    
    self.image_Prompt.frame = CGRectMake(10, 10, 20, 20);
    
    self.title_size.frame = CGRectMake(SCREEN_WIDTH - CGRectGetMaxX(self.image_head.frame) - 25 - 8 - 55, 10, 55, 20);
    
    self.title_name.frame = CGRectMake(CGRectGetMaxX(self.image_Prompt.frame) + 10, 0, SCREEN_WIDTH - CGRectGetMaxX(self.image_head.frame) - 25 - CGRectGetMaxX(self.image_Prompt.frame) - 10 - 63, 40);
    
    self.btn_bg.frame = CGRectMake(0, 0, SCREEN_WIDTH - CGRectGetMaxX(self.image_head.frame) - 10 - 15, 40);
    
    self.view_Line.frame = CGRectMake(0, 99, SCREEN_WIDTH, 1);
}







@end
